-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up destabilize_vs
#1434
Clean up destabilize_vs
#1434
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This is definitely an improvement over the state before where we risked things going out of sync frequently.
src/solver/td3.ml
Outdated
@@ -496,16 +489,19 @@ module Base = | |||
(* solve x Widen *) | |||
in | |||
|
|||
let rec destabilize_normal x = | |||
let rec destabilize_normal ?(notify_destabilized = fun _ _ _ -> ()) x = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the fun argument does not change between invocations it might make sense to have an inner recursive function that does not have this parameters but uses the one from the outside scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a bit premature to me. It's not clear whether the original reasons for separating this are no longer valid or not.
We should add the hook & simplify the control flow and then we can merge it. The other change we do not want to merge for now. |
c83ab9b
to
1082f1c
Compare
Apologies, I had forgotten this was still open. It is now reduced to unwrapping the obscured control flow around || and the hook call. |
Problem
See #1433
Proposed Fix
Remove
destabilize_vs
. To replace its functionality, add an optional callback to alldestabilize
functions, allowing the caller to perform the check whether the global destabilized a stable start variable or a called variable when needed without a dedicateddestabilize
implementation. This way, the additional overhead of going through the start variables check only occurs in side with the "cycle" strategy, just as before.